<template>
  <n-modal
    :show="window_open"
    :on-mask-click="window_off"
    class="modal_gtbox"
    to=".base_gt_index"
    style="width: 800px"
    size="huge"
  >
    <div>
      <div class="modal_gttitle">
        <div class="_x" @click="window_off">X</div>
        {{ title }}
      </div>
      <div class="model_box">
        <div class="dljjc_zy" style="background: #2b303a">
          <div style="width: 100%"><slot name="content"></slot></div>
        </div>
      </div>
      <div class="modal_gtend">
        <n-flex>
          <n-button type="gt_w" :size="cfg.sizebtn" @click="window_off">{{
            offsub_title ?? "关闭窗口"
          }}</n-button>
          <n-button
            type="gt_y"
            v-if="upsub == true"
            :size="cfg.sizebtn"
            @click="$emit('upsub_fun')"
            >{{ upsub_title ?? "提交" }}</n-button
          >
        </n-flex>
      </div>
    </div>
  </n-modal>
</template>
<script>
import { cfg } from "@/cfg/cfg.js";

export default {
  props: {
    window_open: Boolean,
    title: String,
    upsub: Boolean,
    offsub_title: String,
    upsub_title: String,
    upsub_fun: Function,
  },
  methods: {
    window_off() {
      let window_open = this.window_open;
      window_open = false;
      this.$emit("update:window_open", false);
    },
    window_off2() {},
  },
  setup(props) {
    return { cfg };
  },
};
</script>
